package com.zong.ai.agent.demo.two;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author: zongzi
 * @description: TODO
 * @date: 2025/9/15
 */
@Slf4j
//@Component
public class OllamaChatModelDemo implements CommandLineRunner {

    private final ChatModel ollamaChatModel;

    public OllamaChatModelDemo(ChatModel ollamaChatModel) {
        this.ollamaChatModel = ollamaChatModel;
    }

    @Override
    public void run(String... args) throws Exception {
        String response = ollamaChatModel.call("你好，我是粽子");
        log.info("ollama chat model demo response = {}", response);
    }
}
